package function;

import org.apache.flink.table.annotation.DataTypeHint;
import org.apache.flink.table.annotation.FunctionHint;
import org.apache.flink.table.functions.TableFunction;
import org.apache.flink.types.Row;
import util.AtguiguUtil;

import java.util.List;

@FunctionHint(output = @DataTypeHint("row<keyword string>"))
public class KWSplit extends TableFunction<Row> {
    public void eval(String kw) {
        List<String> words=AtguiguUtil.ikSplit(kw);
        for (String word : words) {
            collect(Row.of(word));
        }
    }
}
